# -*- coding:utf-8 -*-
"""
Author：Administrator
Date:2021年08月19日
"""
from docx import Document


file = Document('./练习/练习2.docx')
# print(len(file.tables))
table1 = file.tables[0]
# print(len(table1.rows),len(table1.columns))
# row2 = table1.rows[1]
# row2._element.getparent().remove(row2._element) # 删除第2行
# print(len(table1.rows),len(table1.columns))
# file.save('./练习/08结果01.docx')

# 删除列
col = table1.table.columns[1]
for cell in col.cells:
	cell._element.getparent().remove(cell._element)

file.save('./练习/08结果02.docx')
